/**
var obj = eval('(' + str + ')');
var obj = str.parseJSON(); //由JSON字符串转换为JSON对象
var obj = JSON.parse(str); //由JSON字符串转换为JSON对象
* JSON.stringify(obj);
*/

var $=function(e){return document.getElementById(e)};
var Dialog=(function(){
	var fade,target;
	return {
	   show:function(obj){
		   if(!fade){
			   fade = document.createElement("div");
			   
			   fade.style.cssText='display: none;position: absolute;top: 0%;left: 0%;width: 100%;height: '+(document.documentElement.scrollHeight?(document.documentElement.scrollHeight+"px"):"100%")+';background-color: gray;z-index: 1001;-moz-opacity: 0.8;opacity: .80;filter: alpha(opacity = 80)';
			   fade.onclick=function(){
                  Dialog.hide();
			   }
			   document.body.appendChild(fade);
		   }
		   fade.style.display="block";
		   var light_div = $(obj.id);
		   if(light_div){
			   var top=(100-parseInt(obj.height||'80%'))/2;
			   var left = (100-parseInt(obj.width||'80%'))/2;
			   if(obj.cssText){
				   light_div.style.cssText=obj.cssText;
			   }else{
				   light_div.style.cssText='display: none;position: absolute;top: '+top+'%;left: '+left+'%;width: '+(obj.width||'80%')+';height: '+(obj.height||'80%')+';padding: 0px;border: 5px solid #ff787e;background-color: #FFF;z-index: 1002;overflow: auto;';

			   }
			   light_div.style.display="block";
	           target=light_div;
		   }
	   },
	   hide:function(){
		   fade.style.display="none";
		   target.style.display="none";
	   }
	}
})();